﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using PPI.Client.Interface;
using PPI.Client.Presenter;
using PPI.Entities;

namespace PPI
{
    public partial class frmFilterType : frmBase, IFilterType
    {
        private EBasePosition m_SelectedVisit;
        private FilterTypePresenter m_presenter;
        private string m_connectionString;

        public frmFilterType()
        {
            InitializeComponent();
            MenuMain.Visible = false;
            m_presenter = new FilterTypePresenter(this);
        }

        public string VisitType
        {
            get { return ddlVisitType.Text; }
        }

        public int SelectedId
        {
            get { return txtVisitId.Value; }
        }

        public EBasePosition SelectedVisit
        {
            get { return m_SelectedVisit; }
            set { m_SelectedVisit = value; }
        }

        public string ConnectionString
        {
            get { return m_connectionString; }
            set { m_connectionString = value; }
        }

        private void btnClose_Click(object sender, EventArgs e)
        {
            this.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.Close();
        }

        private void btnSearch_Click(object sender, EventArgs e)
        {
            m_presenter.Search();
            this.DialogResult = System.Windows.Forms.DialogResult.OK;
            this.Close();
        }

        private void frmFilterType_Load(object sender, EventArgs e)
        {
                ddlVisitType.Items.Add("GPS Structure");
                //ddlVisitType.Items.Add("GPS Pole");
                //ddlVisitType.Items.Add("Inspection Structure");
                ddlVisitType.Items.Add("Inspection Pole");
                ddlVisitType.Items.Add("Asset");
        }
    }
}
